﻿using System;
using System.Collections.Generic;
using Rabbit.Logic;
using Raven.Imports.Newtonsoft.Json;

namespace RabbitManage.UI
{
    public partial class DiliveryStrategyEdit : System.Web.UI.Page
    {
        protected DiliveryStrategy item = null;
        protected List<string> listProvince = null;
        protected List<string> listCity = null;
        protected List<ProvinceCity> list;
        protected string provinceJson = string.Empty;
        protected string provinceAfar = CityData.Afar;

        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request["id"];
            if (string.IsNullOrEmpty(id)) return;

            list = CityData.GetMainlandData();
            provinceRepeater.DataSource = list;
            provinceRepeater.DataBind();
            
            item = RabbitUse.GetDiliveryStrategyById(Db.Store, id);
            //listProvince = item.ProvinceList;
            //listCity = item.CityList;
            //provinceRepeater.DataSource = listProvince;
            //cityRepeater.DataSource = listCity;
            //provinceRepeater.DataBind();
            //cityRepeater.DataBind();

            provinceJson = JsonConvert.SerializeObject(item.ProvinceList);
        }
    }
}